package com.oa.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.oa.dao.PostDao;
import com.oa.entity.Post;
import com.oa.service.PostService;

@Service("postService")
@Transactional
public class PostServiceImpl implements PostService{

	@Resource(name="postDao")
	private PostDao postDao;
	//查询所有岗位
	public List<Post> list() {
		return postDao.findAllEntity();
	}
	//添加岗位
	@Override
	public boolean postAdd(Post post) {
		return postDao.saveEntity(post);
	}
	//修改岗位 
	@Override
	public boolean postUpdate(Post post) {
		return postDao.updateEntity(post);
	}
	//撤销岗位
	@Override
	public boolean postDelete(Post post) {
		return postDao.deleteEntity(post);
	}
	// 根据ID 查询单个岗位
	@Override
	public Post getById(String unique_id) {
		return postDao.getEntity(unique_id);
	}
	// 根据ID 查询多个岗位
	@Override
	public List<Post> getByIds(String[] postIds) {
		
		return postDao.getEntityByIds(postIds);
	}

}
